Bandwidth optimization

Bandwidth optimization is one of many concerns webmasters deal with when hosting web content. Since most web hosts charge by bandwidth used or have an account limit on bandwidth, a prudent webmaster will squeeze and compress their files as much as possible without affecting the content's integrity. Lately, most web hosts are offering unlimited bandwidth. Reductions in bandwidth usage are measured in negabytes, a unit akin to other "negative" units such as negawatts, negavolts, negajoules, negameters, and negagrams.

Even the simplest bandwidth optimization techniques can reduce bandwidth costs significantly. Owners of extremely high-volume web services are especially diligent, and have been known to employ extreme techniques to save a few bytes per page. For example, many staple pages are highly optimized - with whitespace and line breaks removed, unneeded quotes removed around HTML attributes, and images compressed to the limit while maintaining clarity.

Most bandwidth optimization techniques can fit into one of three categories: Efficiency, Compression, and Omission.

Contents

Efficiency

Efficiency techniques involve changing the web content in order to minimize the number of bytes that need to be sent. For example, use external files (which will cache) instead of inline styles and scripts, reuse icon images, use semantic markup. Fix any broken images, since these often send a verbose 404 error page.

Compression

Use compression on the server to squash files before they are sent. Compression is a well-established technique in telecommunications, since without significant bandwidth compression, the telephone grid could not handle the amount of data that passes through it. On the web the most popular compression algorithm for real-time compression is gzip. The topic of compression also includes image compression e.g. JPG, PNG, GIF

Also see WAN Optimization

Omission

Omit unneeded bytes. Remove comments, whitespace, and don't send <meta> tags to non-robots.